﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="RoleAssignment.aspx.cs"
    Inherits="BEGDC.CC.Web.CIS2.Domestic.Admin.RoleAssignment" %>

<%@ Register Src="../../../UserControls/Pager.ascx" TagName="Pager" TagPrefix="cc" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title></title>
    <link href="../../../css/global.css" rel="stylesheet" type="text/css" />
    <link href="../../../css/content/entity.css" rel="stylesheet" type="text/css" />
    <link href="../../../css/content/themes/base/jquery-ui.css" rel="stylesheet" type="text/css" />
    <link href="../../../css/main.css" rel="stylesheet" type="text/css" />

    <script src="../../../js/jquery-1.4.4.min.js" type="text/javascript"></script>

    <script src="../../../js/jquery-ui.min.js" type="text/javascript"></script>

    <script src="../../../js/entity.js.aspx" type="text/javascript"></script>

    <style type="text/css">
        .pcat-delete
        {
            margin-top: 4px;
            width: 15px;
            height: 15px;
            display: inline-block;
            background-image: url(../../../css/content/images/delete.gif);
        }
        .entity-row
        {
            clear: both;
        }
        .entity-row input
        {
            float: none;
        }
        .educations-table
        {
            padding: 2px;
        }
        .Role_Area_Class
        {
            float: left;
            width: 100%;
            height: 27px;
        }
        .Role_Area_Class_ul
        {
            float: left;
            padding-top: 2px;
            padding-left: 1px;
        }
        .Role_Area_Class_ul li
        {
            float: left;
        }
        .Role_Area_tab_link
        {
            float: left;
            width: auto;
            height: 25px;
            line-height: 25px;
            background: #ded8f0;
            color: #432584;
            margin-left: 2px;
            padding-left: 10px;
            padding-right: 10px;
        }
        .Role_Area_tab_active
        {
            float: left;
            width: auto;
            height: 25px;
            line-height: 25px;
            background: #6950a1;
            color: white;
            margin-left: 2px;
            padding-left: 10px;
            padding-right: 10px;
        }
        .Commercial_Area_Class
        {
            width: 98%;
            height: auto;
            border: 1px solid #6950a1;
            display: inline-block;
            padding: 5px;
        }
        .entity-row-line
        {
            border-bottom: 1px dashed #cccccc;
            padding: 5px 0;
        }
        .Roles_title
        {
            background: #e8e4f4;
            text-align: center;
            width: 98%;
            margin: 5px;
        }
        .hr
        {
            height: 10px;
            border-bottom: dashed 1px #ccc;
            clear: both;
            overflow: hidden;
        }
        .hr_ccc
        {
            height: 10px;
            border-bottom: solid 1px #ccc;
            clear: both;
            overflow: hidden;
        }
    </style>

    <script type="text/javascript">

        $(function() {
            var rolebind=function(e){
                var username;
                if(e=="0")
                {
                    if($(".auto-bind").children().first().length>0)
                        username = $(".auto-bind").children().first().val();
                    else 
                        username = $(".auto-bind").text();
                }
                else
                    username = e;
                var params = '{cil:"' + username + '"}';
                $.ajax({
                    type: "POST",
                    url: "RoleAssignment.aspx/GetRoleData",
                    data: params,
                    dataType: "json",
                    contentType: "application/json; charset=utf-8",
                    success: function(result) {
                        var res = result.d.split(',');
                        var showRoles="";
                        var flag1=0;
                        var flag2=0;
                        var flag3=0;
                        var flag4=0;
                        var flag5=0;
                        var flag6=0;
                        $("#isadmin").attr("checked",false);
                        $("#showAdmin").text("否");
                        $(".cluster-table").empty();
                        $(".commercial-table").empty();
                        $(".dpso-table").empty();
                        $(".pso-table").empty();
                        $(".sales-table").empty();
                        for(var i=0;i<res.length;i++)
                        {
                            if(res[i]!=="")
                            {
                                var ret = res[i].split(';');
                                if(ret[0]=="Admin")
                                {
                                    $("#isadmin").attr("checked",true);
                                    $("#showAdmin").text("是");
                                }
                                if(ret[0]=="Reviewer")
                                {
                                    $("#isreviewer").attr("checked",true);
                                    $("#showReviewer").text("是");
                                }
                                if(ret[0]=="Cluster")
                                {
                                    $(".cluster-table").append("<div class=\"cluster-row\"><div style=\"display: inline;\">Area:</div><div style=\"display: inline;\" class=\"entity-selects-check\"><select name=\"cluster-select\" class=\"add-cluster-select\"><option value=\"0\">--请选择--</option></select></div><a class='pcat-delete' href='javascript:void(0)'></a><div class=\"hr\"></div></div>");
                                    $(".cluster-table").find(".cluster-row").last().find(".add-cluster-select").html(optionclusterstring);
                                    $(".pcat-delete")
                                        .attr("title", "Remove this item (删除)")
                                        .bind("click", function() {
                                                        $(this).parent().remove();
                                                    });
                                    $(".cluster-table").find(".cluster-row").last().find(".add-cluster-select").last().val(ret[1]);
                                    InputUIShow();
                                    if(flag1==0)
                                    {
                                        showRoles+="Cluster,";
                                        flag1=1;
                                    }
                                }
                                if(ret[0]=="Catvp")
                                {
                                    $(".catvp-table").append("<div class=\"catvp-row\"><div style=\"display: inline;\">CAT:</div> <div style=\"display: inline;\" class=\"entity-selects-check\"><select name=\"catvp-select\" class=\"add-category-select\"><option value=\"0\">--请选择--</option></select></div> <a class='pcat-delete' href='javascript:void(0)'></a><div class=\"hr\"></div></div>");
                                    $(".catvp-table").find(".catvp-row").last().find(".add-category-select").html(optioncategorystring);
                                    $(".pcat-delete")
                                        .attr("title", "Remove this item (删除)")
                                        .bind("click", function() {
                                            $(this).parent().remove();
                                        });
                                    $(".catvp-table").find(".catvp-row").last().find(".add-category-select").last().val(ret[1]);
                                    InputUIShow();
                                    if(flag6==0)
                                    {
                                        showRoles+="CAT VP,";
                                        flag6=1;
                                    }
                                }
                                if(ret[0]=="CommercialP")
                                {
                                    $(".commercial-table").append("<div class=\"commercial-row entity-selects3-check\">Province: <select name=\"commercial-province-select\" class=\"add-province-select dis-province-select\"><option value=\"0\">--请选择--</option></select> CAT:<select name=\"commercial-category-select\" class=\"add-category-select dis-category-select\"><option value=\"0\">--请选择--</option></select> <a class='pcat-delete' href='javascript:void(0)'></a><div class=\"hr\"></div></div>");
                                    $(".commercial-table").find(".commercial-row").last().find(".add-province-select").html(optionprovincestring);
                                    $(".commercial-table").find(".commercial-row").last().find(".add-category-select").html(optioncategorystring);
                                    $(".pcat-delete")
                                        .attr("title", "Remove this item (删除)")
                                        .bind("click", function() {
                                            $(this).parent().remove();
                                        });
                                    $(".dis-province-select").bind("change",function(){
                                        $(this).next().val("0");
                                    });
                                    $(".dis-category-select").bind("change",function(){
                                        $(this).prev().find("option[text='总部']").attr("selected", true);
                                    });
                                    $(".commercial-table").find(".commercial-row").last().find(".add-province-select").last().val(ret[1]);
                                    InputUIShow();
                                    if(flag2==0)
                                    {
                                        showRoles+="Commercial,";
                                        flag2=1;
                                    }
                                }
                                if(ret[0]=="CommercialC")
                                {
                                    $(".commercial-table").append("<div class=\"commercial-row entity-selects3-check\">Province: <select name=\"commercial-province-select\" class=\"add-province-select dis-province-select\"><option value=\"0\">--请选择--</option></select> CAT:<select name=\"commercial-category-select\" class=\"add-category-select dis-category-select\"><option value=\"0\">--请选择--</option></select> <a class='pcat-delete' href='javascript:void(0)'></a><div class=\"hr\"></div></div>");
                                    $(".commercial-table").find(".commercial-row").last().find(".add-province-select").html(optionprovincestring).find("option[text='总部']").attr("selected", true);
                                    $(".commercial-table").find(".commercial-row").last().find(".add-category-select").html(optioncategorystring);
                                    $(".pcat-delete")
                                        .attr("title", "Remove this item (删除)")
                                        .bind("click", function() {
                                            $(this).parent().remove();
                                        });
                                    $(".dis-province-select").bind("change",function(){
                                        $(this).next().val("0");
                                    });
                                    $(".dis-category-select").bind("change",function(){
                                        $(this).prev().find("option[text='总部']").attr("selected", true);
                                    });
                                    $(".commercial-table").find(".commercial-row").last().find(".add-category-select").last().val(ret[1]);
                                    InputUIShow();
                                    if(flag2==0)
                                    {
                                        showRoles+="Commercial,";
                                        flag2=1;
                                    }
                                 }
                                 if(ret[0]=="PSO")
                                 {
                                    $(".pso-table").append("<div class=\"pso-row\"><div style=\"display: inline;\">Province:</div> <div style=\"display: inline;\" class=\"entity-selects-check\"><select name=\"pso-select\" class=\"add-province-select\"><option value=\"0\">--请选择--</option></select></div> <a class='pcat-delete' href='javascript:void(0)'></a><div class=\"hr\"></div></div>");
                                    $(".pso-table").find(".pso-row").last().find(".add-province-select").html(optionprovincestring);
                                    $(".pcat-delete")
                                        .attr("title", "Remove this item (删除)")
                                        .bind("click", function() {
                                            $(this).parent().remove();
                                        });
                                    $(".pso-table").find(".pso-row").last().find(".add-province-select").val(ret[1]);
                                    InputUIShow();
                                    if(flag4==0)
                                    {
                                        showRoles+="PSO,";
                                        flag4=1;
                                    }
                                 }
                                 if(ret[0]=="DPSO")
                                 {
                                    $(".dpso-table").append("<div class=\"dpso-row\"><div style=\"display: inline;\">Province:</div> <div style=\"display: inline;\" class=\"entity-selects-check\"><select name=\"dpso-select\" class=\"add-province-select\"><option value=\"0\">--请选择--</option></select></div> <a class='pcat-delete' href='javascript:void(0)'></a><div class=\"hr\"></div></div>");
                                    $(".dpso-table").find(".dpso-row").last().find(".add-province-select").html(optionprovincestring);
                                    $(".pcat-delete")
                                        .attr("title", "Remove this item (删除)")
                                        .bind("click", function() {
                                            $(this).parent().remove();
                                        });
                                    $(".dpso-table").find(".dpso-row").last().find(".add-province-select").val(ret[1]);
                                    InputUIShow();
                                    if(flag3==0)
                                    {
                                        showRoles+="DPSO,";
                                        flag3=1;
                                    }
                                 }
                                 if(ret[0]=="Sales")
                                 {
                                    $(".sales-table").append("<div class=\"sales-row\"><div style=\"display: inline;\">Province:</div> <div style=\"display: inline;\" class=\"entity-selects-check\"><select name=\"sales-province-select\" class=\"add-province-select\"><option value=\"0\">--请选择--</option></select></div> <div style=\"display: inline;\"> CAT:</div><div style=\"display: inline;\" class=\"entity-selects-check\"><select name=\"sales-category-select\" class=\"add-category-select\"><option value=\"0\">--请选择--</option></select></div> <a class='pcat-delete' href='javascript:void(0)'></a><div class=\"hr\"></div></div>");
                                    $(".sales-table").find(".sales-row").last().find(".add-province-select").html(optionprovincestring);
                                    $(".sales-table").find(".sales-row").last().find(".add-category-select").html(optioncategorystring);
                                    $(".pcat-delete")
                                        .attr("title", "Remove this item (删除)")
                                        .bind("click", function() {
                                            $(this).parent().remove();
                                        });
                                    $(".sales-table").find(".sales-row").last().find(".add-province-select").val(ret[1]);
                                    $(".sales-table").find(".sales-row").last().find(".add-category-select").val(ret[2]);
                                    InputUIShow();
                                    if(flag5==0)
                                    {
                                        showRoles+="Sales,";
                                        flag5=1;
                                    }
                                 }
                                 $("#showRoles").text(showRoles);
                                 
                            }
                        }
                    },
                    error: function(xhr, msg, e) {
                        alert("wrong");
                    }
                });
            };
            $(".user-cil").children().first().autocomplete({
                source: "/cilsearch.aspx",
                minLength: 2,
                select: function(event, ui){
                    rolebind(ui.item.value);
                }
            });
            
            var provincestring =<%=GetProvinceSelect() %>;
            var provinceObj = jQuery.parseJSON(provincestring);
            var optionprovincestring = "";
            for(var item in provinceObj)
            {
            optionprovincestring += "<option value=\""+ provinceObj[item] +"\" >"+ item +"</option>";
            }
            $(".add-province-select").html(optionprovincestring);
            
            var categorystring =<%=GetCategorySelect() %>;
            var categoryObj = jQuery.parseJSON(categorystring);
            var optioncategorystring = "";
            for(var item in categoryObj)
            {
            optioncategorystring += "<option value=\""+ categoryObj[item] +"\" >"+ item +"</option>";
            }
            $(".add-category-select").html(optioncategorystring);
            
            var clusterstring =<%=GetClusterSelect() %>;
            var clusterObj = jQuery.parseJSON(clusterstring);
            var optionclusterstring = "";
            for(var item in clusterObj)
            {
            optionclusterstring += "<option value=\""+ clusterObj[item] +"\" >"+ item +"</option>";
            }
            $(".add-cluster-select").html(optionclusterstring);
            
            $(".commercial-add")
                .bind("click",function(){
                    $(".commercial-table").append("<div class=\"commercial-row entity-selects3-check\">Province: <select name=\"commercial-province-select\" class=\"add-province-select dis-province-select\"><option value=\"0\">--请选择--</option></select> CAT: <select name=\"commercial-category-select\" class=\"add-category-select dis-category-select\"><option value=\"0\">--请选择--</option></select> <a class='pcat-delete' href='javascript:void(0)'></a><div class=\"hr\"></div></div>");
                    $(".commercial-table").find(".commercial-row").last().find(".add-province-select").html(optionprovincestring);
                    $(".commercial-table").find(".commercial-row").last().find(".add-category-select").html(optioncategorystring);
                    $(".pcat-delete")
                        .attr("title", "Remove this item (删除)")
                        .bind("click", function() {
                            $(this).parent().remove();
                        });
                    $(".dis-province-select").bind("change",function(){
                        $(this).next().val("0");
                    });
                    $(".dis-category-select").bind("change",function(){
                        $(this).prev().find("option[text='总部']").attr("selected", true);
                    });
                    InputUIShow();
                });
                
            $(".cluster-add")
                .bind("click",function(){
                    $(".cluster-table").append("<div class=\"cluster-row\"><div style=\"display: inline;\">Area:</div> <div style=\"display: inline;\" class=\"entity-selects-check\"><select name=\"cluster-select\" class=\"add-cluster-select\"><option value=\"0\">--请选择--</option></select></div> <a class='pcat-delete' href='javascript:void(0)'></a><div class=\"hr\"></div></div>");
                    $(".cluster-table").find(".cluster-row").last().find(".add-cluster-select").html(optionclusterstring);
                    $(".pcat-delete")
                        .attr("title", "Remove this item (删除)")
                        .bind("click", function() {
                            $(this).parent().remove();
                        });
                    InputUIShow();
                });
                
             $(".catvp-add")
                .bind("click",function(){
                    $(".catvp-table").append("<div class=\"catvp-row\"><div style=\"display: inline;\">CAT:</div> <div style=\"display: inline;\" class=\"entity-selects-check\"><select name=\"catvp-select\" class=\"add-category-select\"><option value=\"0\">--请选择--</option></select></div> <a class='pcat-delete' href='javascript:void(0)'></a><div class=\"hr\"></div></div>");
                    $(".catvp-table").find(".catvp-row").last().find(".add-category-select").html(optioncategorystring);
                    $(".pcat-delete")
                        .attr("title", "Remove this item (删除)")
                        .bind("click", function() {
                            $(this).parent().remove();
                        });
                    InputUIShow();
                });
            
             $(".dpso-add")
                .bind("click",function(){
                    $(".dpso-table").append("<div class=\"dpso-row\"><div style=\"display: inline;\">Province:</div> <div style=\"display: inline;\" class=\"entity-selects-check\"><select name=\"dpso-select\" class=\"add-province-select\"><option value=\"0\">--请选择--</option></select></div> <a class='pcat-delete' href='javascript:void(0)'></a><div class=\"hr\"></div></div>");
                    $(".dpso-table").find(".dpso-row").last().find(".add-province-select").html(optionprovincestring);
                    $(".pcat-delete")
                        .attr("title", "Remove this item (删除)")
                        .bind("click", function() {
                            $(this).parent().remove();
                        });
                    InputUIShow();
                });
                
            $(".pso-add")
                .bind("click",function(){
                    $(".pso-table").append("<div class=\"pso-row\"><div style=\"display: inline;\">Province:</div> <div style=\"display: inline;\" class=\"entity-selects-check\"><select name=\"pso-select\" class=\"add-province-select\"><option value=\"0\">--请选择--</option></select></div> <a class='pcat-delete' href='javascript:void(0)'></a><div class=\"hr\"></div></div>");
                    $(".pso-table").find(".pso-row").last().find(".add-province-select").html(optionprovincestring);
                    $(".pcat-delete")
                        .attr("title", "Remove this item (删除)")
                        .bind("click", function() {
                            $(this).parent().remove();
                        });
                    InputUIShow();
                });
            
            $(".sales-add")
                .bind("click",function(){
                    $(".sales-table").append("<div class=\"sales-row\"><div style=\"display: inline;\">Province:</div> <div style=\"display: inline;\" class=\"entity-selects-check\"><select name=\"sales-province-select\" class=\"add-province-select\"><option value=\"0\">--请选择--</option></select></div><div style=\"display: inline;\">CAT:</div><div style=\"display: inline;\" class=\"entity-selects-check\"><select name=\"sales-category-select\" class=\"add-category-select\"><option value=\"0\">--请选择--</option></select></div> <a class='pcat-delete' href='javascript:void(0)'></a><div class=\"hr\"></div></div>");
                    $(".sales-table").find(".sales-row").last().find(".add-province-select").html(optionprovincestring);
                    $(".sales-table").find(".sales-row").last().find(".add-category-select").html(optioncategorystring);
                    $(".pcat-delete")
                        .attr("title", "Remove this item (删除)")
                        .bind("click", function() {
                            $(this).parent().remove();
                        });
                    InputUIShow();
                });
            
            $(".dis-province-select").bind("change",function(){
                $(this).next().val("0");
            });
            $(".dis-category-select").bind("change",function(){
                $(this).prev().val("0");
            });
            
            
            $(".auto-bind").text(function(){
                rolebind("0");
            });
            
            
        });
    </script>

</head>
<body>
    <form runat="server">
    <div class="mainbox">
        <div class="sitemapbox">
            <div id="info" class="sitemap">
                &nbsp;&raquo;&nbsp;Administration&nbsp;&raquo;&nbsp;Role Assignment
            </div>
        </div>
        <table class="float_lft" cellspacing="0" cellpadding="0">
            <tr>
                <td>
                    <!--tab区域-->
                    <div class="tabbox purplebg_dark">
                        <ul class="tabpos">
                            <li><span class="tab_active">
                                <%=Resources.PageTitles.RoleAssignment %></span></li>
                        </ul>
                    </div>
                    <div class="formbox">
                        <span class=" float_lft">
                            <div class="formbox_float_lft">
                                <asp:Button ID="btnAdd" runat="server" CssClass="entity-add" />
                            </div>
                            <div class="formbox_float_rgt">
                                <asp:TextBox ID="txtSearch" runat="server" CssClass="txtbox width140 entity-search-text"
                                    ToolTip="CIL,Roles"></asp:TextBox>
                                <asp:Button ID="btnSearch" runat="server" CssClass="entity-search" />
                                <asp:Button ID="btnClear" runat="server" CssClass="entity-clear" />
                                <asp:Panel ID="gridPanel" runat="server" CssClass="formbox_float_lft">
                                    <asp:CheckBox runat="server" ID="admin" Text=" Is Admin" OnCheckedChanged="admin_CheckedChanged"
                                        AutoPostBack="true" />
                                </asp:Panel>
                            </div>
                        </span>
                    </div>
                </td>
            </tr>
        </table>
        <table width="100%" id="Table1" cellspacing="0" cellpadding="0" border="0">
            <tbody>
                <tr>
                    <td>
                        <asp:GridView ID="gvMain" runat="server" DataSourceID="edsMain" AllowPaging="true"
                            AllowSorting="true" AutoGenerateColumns="False" CssClass="tablestyle">
                            <RowStyle CssClass="tbody" />
                            <HeaderStyle CssClass="thead" ForeColor="#ffffff" />
                            <Columns>
                                <asp:BoundField DataField="EmployeeNo" HeaderText="Employee No<br/>员工号" SortExpression="EmployeeNo"
                                    HtmlEncode="false" ItemStyle-Width="9%" />
                                <asp:BoundField DataField="NameEN" HeaderText="CIL<br/>员工CIL" SortExpression="NameEN"
                                    HtmlEncode="false" ItemStyle-Width="12%" />
                                <asp:BoundField DataField="NameCN" HeaderText="Display Name<br/>用户显示名" SortExpression="NameCN"
                                    HtmlEncode="false" ItemStyle-Width="12%" />
                                <asp:TemplateField HeaderText="Roles<br/>用户现有角色">
                                    <ItemTemplate>
                                        <asp:Repeater runat="server" DataSource='<%# GetRoles(GetDataItemX()) %>'>
                                            <ItemTemplate>
                                                <%#Eval("Name") %>
                                                [<%#Eval("BelongsTo") %>],
                                            </ItemTemplate>
                                        </asp:Repeater>
                                    </ItemTemplate>
                                    <ItemStyle Width="51%" />
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Is Admin<br/>是否是管理员">
                                    <ItemTemplate>
                                        <%# GetIsAdmin(IsAdmin(GetDataItemX()))%>
                                    </ItemTemplate>
                                    <ItemStyle Width="9%" />
                                </asp:TemplateField>
                                <asp:ActionField HeaderText="Action<br />操作" ShowViewButton="true" ShowModifyButton="true"
                                    HeaderStyle-CssClass="entity-action" />
                            </Columns>
                            <PagerTemplate>
                                <cc:Pager runat="server" />
                            </PagerTemplate>
                        </asp:GridView>
                        <asp:DetailsView ID="dvMain" runat="server" DataKeyNames="EmployeeNo" AutoGenerateRows="False"
                            DataSourceID="edsMain" CssClass="tablestyle2" Width="900">
                            <HeaderStyle CssClass="tablestyle2_Title"></HeaderStyle>
                            <HeaderTemplate>
                                <%=Resources.PageTitles.RoleAssignment %>
                            </HeaderTemplate>
                            <FieldHeaderStyle CssClass="tablestyle2_tdTitle" />
                            <Fields>
                                <asp:TemplateField HeaderText="Employee No (员工号)">
                                    <ItemTemplate>
                                        <%#Eval("EmployeeNo") %></ItemTemplate>
                                    <InsertItemTemplate>
                                    </InsertItemTemplate>
                                </asp:TemplateField>
                                <asp:CustomizeBoundField DataField="NameEN" HeaderText="CIL (CIL号)" ItemStyle-CssClass="entity-notnull-check entity-length-check user-cil auto-bind"
                                    MaxLength="50" />
                                <asp:TemplateField HeaderText="Is Admin (是否是管理员)">
                                    <ItemTemplate>
                                        <label id="showAdmin">
                                            否</label></ItemTemplate>
                                    <InsertItemTemplate>
                                        <input type="checkbox" name="isadmin" id="isadmin" class="isadmin_input" />Admin</InsertItemTemplate>
                                    <EditItemTemplate>
                                        <input type="checkbox" name="isadmin" id="isadmin" class="isadmin_input" />Admin</EditItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Is Reviewer (是否是审核员)">
                                    <ItemTemplate>
                                        <label id="showReviewer">
                                            否</label></ItemTemplate>
                                    <InsertItemTemplate>
                                        <input type="checkbox" name="isreviewer" id="isreviewer" class="isreviewer_input" />Reviewer</InsertItemTemplate>
                                    <EditItemTemplate>
                                        <input type="checkbox" name="isreviewer" id="isreviewer" class="isreviewer_input" />Reviewer</EditItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Roles (角色)">
                                    <ItemTemplate>
                                        <label id="showRoles">
                                        </label>
                                    </ItemTemplate>
                                    <InsertItemTemplate>
                                        <div>
                                            <p class="Roles_title">
                                                Commercial:</p>
                                            <div class="commercial-table">
                                            </div>
                                            <a href="javascript:void(0)" class="commercial-add btn" title="<%#Resources.GlobalButton.AddCommercialTips %>">
                                                <%#Resources.GlobalButton.AddCommercial%></a>
                                        </div>
                                        <div>
                                            <p class="Roles_title">
                                                Cluster:</p>
                                            <div class="cluster-table">
                                            </div>
                                            <a href="javascript:void(0)" class="cluster-add btn" title="<%#Resources.GlobalButton.AddClusterTips %>">
                                                <%#Resources.GlobalButton.AddCluster%></a>
                                        </div>
                                        <div>
                                            <p class="Roles_title">
                                                CAT VP:</p>
                                            <div class="catvp-table">
                                            </div>
                                            <a href="javascript:void(0)" class="catvp-add btn" title="<%#Resources.GlobalButton.AddCatvpTips %>">
                                                <%#Resources.GlobalButton.AddCatvp%></a>
                                        </div>
                                        <div>
                                            <p class="Roles_title">
                                                PSO:</p>
                                            <div class="pso-table">
                                            </div>
                                            <a href="javascript:void(0)" class="pso-add btn" title="<%#Resources.GlobalButton.AddDPSOTips %>">
                                                <%#Resources.GlobalButton.AddDPSO%></a>
                                        </div>
                                        <div>
                                            <p class="Roles_title">
                                                DPSO:</p>
                                            <div class="dpso-table">
                                            </div>
                                            <a href="javascript:void(0)" class="dpso-add btn" title="<%#Resources.GlobalButton.AddDPSOTips %>">
                                                <%#Resources.GlobalButton.AddDPSO%></a>
                                        </div>
                                        <div>
                                            <p class="Roles_title">
                                                Sales:</p>
                                            <div class="sales-table">
                                            </div>
                                            <a href="javascript:void(0)" class="sales-add btn" title="<%#Resources.GlobalButton.AddCommercialTips %>">
                                                <%#Resources.GlobalButton.AddCommercial%></a>
                                        </div>
                                    </InsertItemTemplate>
                                    <EditItemTemplate>
                                        <div>
                                            <p class="Roles_title">
                                                Commercial:</p>
                                            <div class="commercial-table">
                                            </div>
                                            <a href="javascript:void(0)" class="commercial-add btn" title="<%#Resources.GlobalButton.AddCommercialTips %>">
                                                <%#Resources.GlobalButton.AddCommercial%></a>
                                        </div>
                                        <div>
                                            <p class="Roles_title">
                                                Cluster:</p>
                                            <div class="cluster-table">
                                            </div>
                                            <a href="javascript:void(0)" class="cluster-add btn" title="<%#Resources.GlobalButton.AddClusterTips %>">
                                                <%#Resources.GlobalButton.AddCluster%></a>
                                        </div>
                                        <div>
                                            <p class="Roles_title">
                                                CAT VP:</p>
                                            <div class="catvp-table">
                                            </div>
                                            <a href="javascript:void(0)" class="catvp-add btn" title="<%#Resources.GlobalButton.AddCatvpTips %>">
                                                <%#Resources.GlobalButton.AddCatvp%></a>
                                        </div>
                                        <div>
                                            <p class="Roles_title">
                                                PSO:</p>
                                            <div class="pso-table">
                                            </div>
                                            <a href="javascript:void(0)" class="pso-add btn" title="<%#Resources.GlobalButton.AddDPSOTips %>">
                                                <%#Resources.GlobalButton.AddDPSO%></a>
                                        </div>
                                        <div>
                                            <p class="Roles_title">
                                                DPSO:</p>
                                            <div class="dpso-table">
                                            </div>
                                            <a href="javascript:void(0)" class="dpso-add btn" title="<%#Resources.GlobalButton.AddDPSOTips %>">
                                                <%#Resources.GlobalButton.AddDPSO%></a>
                                        </div>
                                        <div>
                                            <p class="Roles_title">
                                                Sales:</p>
                                            <div class="sales-table">
                                            </div>
                                            <a href="javascript:void(0)" class="sales-add btn" title="<%#Resources.GlobalButton.AddCommercialTips %>">
                                                <%#Resources.GlobalButton.AddCommercial%></a>
                                        </div>
                                    </EditItemTemplate>
                                </asp:TemplateField>
                                <asp:ActionField ShowEditButton="true" ShowInsertButton="true" ShowInsertMoreButton="true"
                                    ShowCloseButton="true" />
                            </Fields>
                        </asp:DetailsView>
                        <%--数据源--%>
                        <asp:EntityDataSource ID="edsMain" runat="server" ConnectionString="name=CCEntities"
                            DefaultContainerName="CCEntities" EntitySetName="Employees" Include="Roles" EnableInsert="True"
                            EnableUpdate="True" Where="it.IsEnabled=true and it.IsActived=true">
                        </asp:EntityDataSource>
                        &nbsp;
                    </td>
                </tr>
            </tbody>
        </table>
    </div>
    </form>
</body>
</html>
